package com.hch.datastructure.linkedlist;

public class SingleNode<T> {

    private T data;
    private Integer serialNum;
    private SingleNode<T> next;

    public SingleNode(Integer serialNum) {
        this.serialNum = serialNum;
        this.data = null;
        this.next = null;
    }

    public SingleNode(T data) {
        this.data = data;
        this.serialNum = 0;
        this.next = null;
    }

    public SingleNode(int serialNum, T data) {
        this.data = data;
        this.serialNum = serialNum;
        this.next = null;
    }

    public int getSerialNum() {
        return serialNum;
    }

    public void setSerialNum(int serialNum) {
        this.serialNum = serialNum;
    }


    public T getData() {
        return data;
    }

    public void setData(T data) {
        this.data = data;
    }

    public SingleNode<T> getNext() {
        return next;
    }

    public void setNext(SingleNode<T> next) {
        this.next = next;
    }

    @Override
    public String toString() {
        return "SingleNode{" +
                "data=" + data +
                ", serialNum=" + serialNum +
                ", next=" + next +
                '}';
    }
}
